/******************************************************************************

	filename :  Tile.fx
	version  :  0.1
	author   :  Bernardo Z. Cinco Jr.
	date     :  July 19, 2010   
	
	Description:
	 > The tile itself.
		

******************************************************************************/

package mythesis.gui.tile;
import javafx.scene.*;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;



public class Tile extends CustomNode
{   
    public var numWidth:Number = 500;
    public var strColor:String = "#538ED5";
    public var numType:Number  = 0;
    //public var g:Group;
    var root:String = {__DIR__}.substring(0, {__DIR__}.length()-9);
    var url:String ="{root}resource/icoTileDefault.png"; 
   
	var icoTile = Image
	{
	    url: url;
	}
	
	public function laman(i:Integer)
	{
	    return g.content[i];
	}
	
    public var g = Group{
		content:
        [

        	Rectangle
        	{
        	    width     : numWidth;
        	    height    : 20;
        	    arcWidth  : 10;
        	    arcHeight : 20;
        	    fill      : Color.web(strColor);
        	}
        	ImageView
        	{
        	    image	  : icoTile;
        	    translateX: 10;
        	    translateY: 1;
        	}
        	TileContent
        	{
        	    numType   : numType;
        	    translateY: 15;
        	}
        ]
    }
    
    /*
    {
        content:
        [

        	Rectangle
        	{
        	    width     : numWidth;
        	    height    : 20;
        	    arcWidth  : 10;
        	    arcHeight : 20;
        	    fill      : Color.web(strColor);
        	}
        	ImageView
        	{
        	    image	  : icoTile;
        	    translateX: 10;
        	    translateY: 1;
        	}
        	TileContent
        	{
        	    numType   : numType;
        	    translateY: 15;
        	}
        ]
    }*/
    
    override function create():Node
    {
    	return g;
    }
}